<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			function Person(name,age,gender){
				this.name=name;
				this.age=age;
				this.gender=gender;
			}
		/*修改Person原型的toString*/
			Person.prototype.toString=function(){
				return "Person[name="+this.name+",age="+this.age+",gender="+this.gender+"]";	
			};
			var per=new Person("张三",19,"男");
			var result=per.toString();
			console.log(result);
			console.log(per);
		/*设置为空后，自动进行垃圾回收*/
			per=null;
			
		</script>
	</head>
	<body>
	</body>
</html>
